package kr.or.javacafe.index.controller;

import java.util.List;

import kr.or.javacafe.board.bo.BoardBO;
import kr.or.javacafe.board.domain.Article;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {
	@SuppressWarnings("unused")
	private static Logger logger = LoggerFactory.getLogger(IndexController.class);
		
	@Autowired
	BoardBO boardBO;

	
	
	@RequestMapping("index")
	public String index(Model model) {
		
		List<Article> objPreviewNoticeList = boardBO.getPreviewNoticeArticle();
		List<Article> objPreviewRecentList = boardBO.getPreviewRecentArticle();
		
		model.addAttribute("objPreviewNoticeList", objPreviewNoticeList);
		model.addAttribute("objPreviewRecentList", objPreviewRecentList);
		model.addAttribute("SCROLL_PREVIEW", "TRUE");
		return "index";
	}


}